import web

urls = (
    '/', 'index',
    '/add', 'add'
)

render = web.template.render('templates/')

accountList = ['root', 'huawei']


class index:

    def GET(self):
        return render.index(accountList)


class add:

    def POST(self):
#         i = web.input()
        i = web.input(name='title')
        
        for x in i:
            accountList.append(x.title)
        
        raise web.seeother('/')

    
if __name__ == "__main__": 
    
    app = web.application(urls, globals())
    app.run()
